#pragma once
#include "Transform.h"
#include "DAEFloat3.h"

/**
* This class encapsulates a Quaternion transformation,
* which is a rotation around a given axis.
* @author Koen Samyn
*/ 
class QuaternionTransform: public Transform
{
public:
	/**
	* Creates a new Quaternion transform object
	*/
	QuaternionTransform(void);
	/**
	* Destroys the Quaternion transform object
	*/
	~QuaternionTransform(void);

	/**
	* Set the parameters for an angle , axis rotation (quaternion).
	* @param x the x part of the axis.
	* @param y the y part of the axis.
	* @param z the z part of the axis.
	* @param angle the angle for the rotation.
	*/
	void SetAxisAngleRotation(float x,float y, float z, float angle){
		m_Axis.x=x;
		m_Axis.y=y;
		m_Axis.z=z;
		m_Angle=angle;
		m_Changed=true;
	}
	/**
	*
	* Set the parameter for an angle, axis rotation (quaternion).
	* @param axis A DAEFloat3 object with the axis data.
	* @param angle the angle for the rotation.
	*/
	void SetAxisAngleRotation(const DAEFloat3& axis,float angle){
		m_Axis=axis;
		m_Angle=angle;
		m_Changed=true;
	}

	/**
	* Returns the axis for an angle axis rotation.
	* @return the DAEFloat3 object with the axis information.
	*/
	DAEFloat3& GetAxis(){return m_Axis;}
	/**
	* Returns the angle for an angle axis rotation.
	* @return the angle in radians.
	*/
	float GetAngle(){return m_Angle;}
	/**
	* Resets the parameters of the transform.
	* Must be implemented by subclass.
	*/
	void ResetTransformParameters();
	/**
	* Recalculates the matrix
	*/
	void RecalculateMatrix() const;
private:
	/**
	* Angle for angle axis rotation
	*/
	float m_Angle;
	/**
	* Axis for angle axis rotation
	*/
	DAEFloat3 m_Axis;
};
